{
"cells": [
{
"cell_type": "markdown",
"id": "4eb1ee6b-58d5-4f68-8c56-645b4ce23705",
"metadata": {},
"source": [
"# pyopenms"
]
},
{
"cell_type": "raw",
"id": "7b7f7b40-9948-4035-9d1e-6013e327d49f",
"metadata": {
"editable": true,
"raw_mimetype": "text/html",
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"\n",
" \n",
"\n",
"
"
]
},
{
"cell_type": "markdown",
"id": "67055e7c-e4e2-4648-8df6-ea04f17e1809",
"metadata": {},
"source": [
"## Install pyopenms"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "70b62198-0dba-4573-8dbe-19f31a10c7f4",
"metadata": {},
"outputs": [],
"source": [
"!pip install pyopenms --quiet"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "0c68afe3-cd59-424a-b822-46ffca16456a",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"File test.mzML downloaded successfully!\n"
]
}
],
"source": [
"import requests\n",
"\n",
"url = 'https://raw.githubusercontent.com/levitsky/pyteomics/master/tests/test.mzML'\n",
"file_name = 'test.mzML'\n",
"\n",
"# # Send a GET request to the URL\n",
"response = requests.get(url)\n",
"\n",
"# # Save the content of the response to a file\n",
"with open(file_name, 'wb') as file:\n",
" file.write(response.content)\n",
"\n",
"print(f'File {file_name} downloaded successfully!')"
]
},
{
"cell_type": "markdown",
"id": "53eabf53-784c-4147-b589-e989ed17f9a3",
"metadata": {},
"source": [
"## Load `.mzML` file and convert to `pd.DataFrame`"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "61f85915-0450-499d-a451-38c6d26b4315",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n", " | RT | \n", "mz | \n", "inty | \n", "
---|---|---|---|
0 | \n", "0.2961 | \n", "200.000183 | \n", "0.0 | \n", "
1 | \n", "0.2961 | \n", "200.000427 | \n", "0.0 | \n", "
2 | \n", "0.2961 | \n", "200.000671 | \n", "0.0 | \n", "
3 | \n", "0.2961 | \n", "200.000916 | \n", "0.0 | \n", "
4 | \n", "0.2961 | \n", "202.605835 | \n", "0.0 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "
39823 | \n", "0.3561 | \n", "1999.913086 | \n", "0.0 | \n", "
39824 | \n", "0.3561 | \n", "1999.937256 | \n", "0.0 | \n", "
39825 | \n", "0.3561 | \n", "1999.961548 | \n", "0.0 | \n", "
39826 | \n", "0.3561 | \n", "1999.985718 | \n", "0.0 | \n", "
39827 | \n", "0.3561 | \n", "2000.009888 | \n", "0.0 | \n", "
39828 rows × 3 columns
\n", "\n", " | mz | \n", "intensity | \n", "ion_mobility | \n", "ion_mobility_unit | \n", "ms_level | \n", "precursor_mz | \n", "precursor_charge | \n", "native_id | \n", "sequence | \n", "ion_annotation | \n", "base peak m/z | \n", "base peak intensity | \n", "total ion current | \n", "lowest observed m/z | \n", "highest observed m/z | \n", "filter string | \n", "preset scan configuration | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "200.000188 | \n", "0.0 | \n", "NaN | \n", "<NONE> | \n", "1 | \n", "0.0 | \n", "0 | \n", "controllerType=0 controllerNumber=1 scan=1 | \n", "\n", " | \n", " | 810 | \n", "1471973 | \n", "15245068 | \n", "200 | \n", "2000 | \n", "FTMS + p ESI Full ms [200.00-2000.00] | \n", "1 | \n", "
1 | \n", "200.000430 | \n", "0.0 | \n", "NaN | \n", "<NONE> | \n", "1 | \n", "0.0 | \n", "0 | \n", "controllerType=0 controllerNumber=1 scan=1 | \n", "\n", " | \n", " | 810 | \n", "1471973 | \n", "15245068 | \n", "200 | \n", "2000 | \n", "FTMS + p ESI Full ms [200.00-2000.00] | \n", "1 | \n", "
2 | \n", "200.000673 | \n", "0.0 | \n", "NaN | \n", "<NONE> | \n", "1 | \n", "0.0 | \n", "0 | \n", "controllerType=0 controllerNumber=1 scan=1 | \n", "\n", " | \n", " | 810 | \n", "1471973 | \n", "15245068 | \n", "200 | \n", "2000 | \n", "FTMS + p ESI Full ms [200.00-2000.00] | \n", "1 | \n", "
3 | \n", "200.000915 | \n", "0.0 | \n", "NaN | \n", "<NONE> | \n", "1 | \n", "0.0 | \n", "0 | \n", "controllerType=0 controllerNumber=1 scan=1 | \n", "\n", " | \n", " | 810 | \n", "1471973 | \n", "15245068 | \n", "200 | \n", "2000 | \n", "FTMS + p ESI Full ms [200.00-2000.00] | \n", "1 | \n", "
4 | \n", "202.605829 | \n", "0.0 | \n", "NaN | \n", "<NONE> | \n", "1 | \n", "0.0 | \n", "0 | \n", "controllerType=0 controllerNumber=1 scan=1 | \n", "\n", " | \n", " | 810 | \n", "1471973 | \n", "15245068 | \n", "200 | \n", "2000 | \n", "FTMS + p ESI Full ms [200.00-2000.00] | \n", "1 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
19909 | \n", "1999.913081 | \n", "0.0 | \n", "NaN | \n", "<NONE> | \n", "1 | \n", "0.0 | \n", "0 | \n", "controllerType=0 controllerNumber=1 scan=1 | \n", "\n", " | \n", " | 810 | \n", "1471973 | \n", "15245068 | \n", "200 | \n", "2000 | \n", "FTMS + p ESI Full ms [200.00-2000.00] | \n", "1 | \n", "
19910 | \n", "1999.937296 | \n", "0.0 | \n", "NaN | \n", "<NONE> | \n", "1 | \n", "0.0 | \n", "0 | \n", "controllerType=0 controllerNumber=1 scan=1 | \n", "\n", " | \n", " | 810 | \n", "1471973 | \n", "15245068 | \n", "200 | \n", "2000 | \n", "FTMS + p ESI Full ms [200.00-2000.00] | \n", "1 | \n", "
19911 | \n", "1999.961513 | \n", "0.0 | \n", "NaN | \n", "<NONE> | \n", "1 | \n", "0.0 | \n", "0 | \n", "controllerType=0 controllerNumber=1 scan=1 | \n", "\n", " | \n", " | 810 | \n", "1471973 | \n", "15245068 | \n", "200 | \n", "2000 | \n", "FTMS + p ESI Full ms [200.00-2000.00] | \n", "1 | \n", "
19912 | \n", "1999.985729 | \n", "0.0 | \n", "NaN | \n", "<NONE> | \n", "1 | \n", "0.0 | \n", "0 | \n", "controllerType=0 controllerNumber=1 scan=1 | \n", "\n", " | \n", " | 810 | \n", "1471973 | \n", "15245068 | \n", "200 | \n", "2000 | \n", "FTMS + p ESI Full ms [200.00-2000.00] | \n", "1 | \n", "
19913 | \n", "2000.009947 | \n", "0.0 | \n", "NaN | \n", "<NONE> | \n", "1 | \n", "0.0 | \n", "0 | \n", "controllerType=0 controllerNumber=1 scan=1 | \n", "\n", " | \n", " | 810 | \n", "1471973 | \n", "15245068 | \n", "200 | \n", "2000 | \n", "FTMS + p ESI Full ms [200.00-2000.00] | \n", "1 | \n", "
19914 rows × 17 columns
\n", "